<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Cache-control" content="no-cache">
<meta http-equiv="Cache" content="no-cache">
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="shortcut icon" href="/favicon.ico">
<meta name="viewport"
	content="initial-scale = 1.0, maximum-scale = 1.0, user-scalable = no, width = device-width">
<link rel="shortcut icon" href="favicon.ico">
<link href="/css/bootstrap.min.css?v=3.3.5" rel="stylesheet">
<link href="/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
<link href="/common/css/monitor/index_server_info.css" rel="stylesheet" />
</head>
<style type="text/css">

</style>

<body style="background-color: #f3f3f4;">
	<div class="ibox float-e-margins">
        <div class="ibox-content">
            <div class="row row-lg">
                <div class="col-sm-12">
                    <div class="example-wrap">
                        <div class="btn-group hidden-xs" id="exampleTableEventsToolbar" role="group">
                             <form id="seachform"></form>
                        </div>
                        <table id="serverSoftList">
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
	<!-- End Panel Other -->
	<script src="/js/jquery.min.js?v=2.1.4"></script>
	<script src="/js/bootstrap.min.js?v=3.3.5"></script>
	<script src="/js/content.min.js?v=1.0.0"></script>
	<script src="/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
	<script src="/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
	<script src="/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
	<script src="/common/petecat.js"></script>
	<script src="/common/form.js"></script>	
	<!-- HTML之间的传值 -->
	<script src="/js/jquery.params.js"></script>
	<script src="/js/plugins/layer-pc/layer.js"></script>
	<script src="/js/jquery.cookie.js"></script>
	<script src="/common/bootstrap-table-treetable.js"></script>
	<script src="/common/bootstrap-table.js"></script>
	<!-- 组件通用 -->
	<script src="/common/frame.js"></script>
	<script type="text/javascript">
		var serverMac = GetQueryString("serverMac");
		var token = GetQueryString("proToken");
		$(function() {	
			var table = {};
	    	table['id'] = 'serverSoftList';
	    	table['url'] = BASE_URL+'/base/project/queryEsSoftwareInfo',
	    	table['pagination'] = true,
	    	table['queryParams'] = function(params){
	    		var queryParams = queryBaseParams(params);
	    		queryParams['serverMac'] = serverMac;
	    		queryParams['token'] = token;
	            return queryParams;
	    	};
	    	table['columns'] = [{
		    	 field:'name',
		         title:'name'
				},{
		    	 field:'memoryPercent',
		         title:'memoryPercent'
			    },{
		    	 field:'createTime',
		         title:'创建时间',
	             formatter:function(value,row,index){
	            	 return timeTransfoTime(value+"000");
	             }
		    	},{
		    	 field:'userName',
		         title:'userName'
			    },{
		    	 field:'numThreads',
		         title:'numThreads'
			    },{
		    	 field:'pid',
		         title:'pid'
				},{
		    	 field:'cpuTimes',
		         title:'cpuTimes',
	             formatter:function(value,row,index){
	            	 return "<span style='color:red' user="+value.user+" cuser="+value.childrenUser+" system="+value.system+" csystem="+value.childrenSystem+" class='lookTime'>查看Cpu时间</span>";
	             }
				},{
		    	 field:'pid',
		         title:'pid'
				},
			    {
		    	 field:'status',
		         title:'状态',
	             formatter:function(value,row,index){
	            	 return value == 0 ?"<span style='color:red'>停止运行</span>":"<span style='color:#00FF00'>正在运行</span>";
	             }
				}];
	    	initTable(table);
	    	
	    	$("#serverSoftList").on("click",".lookTime",function(){
	    		var user = $(this).attr("user");
	    		var cuser = $(this).attr("cuser");
	    		var system = $(this).attr("system");
	    		var csystem = $(this).attr("csystem");
				layer.open({
					type:2,
					title:"查看CPU时间",
					shade: 0.8,
					area: ['380px', '40%'],
	                content: ['/monitor/software/look_cpu_time.html'], 
	                end: function(){ //此处用于演示
	                },
	                success:function(layers,index){
	                	var body = layer.getChildFrame('body',index);
	                	body.find("#user").text(user);
	                	body.find("#system").text(system);
	                	body.find("#childrenUser").text(cuser);
	                	body.find("#childrenSystem").text(csystem);
	                }
				});
			});
	    	
		});
		
		
	</script>

</body>
</html>